package com.huike.web.controller.report;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.huike.common.core.domain.AjaxResult;
import com.huike.report.service.IReportService;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IReportService reportService;

    /*获取当天简报信息*/
    @GetMapping("/getTodayInfo")
    public AjaxResult getTodayInfo(){
        return AjaxResult.success(reportService.getTodayInfo());
    }

    /**
     * 首页--基础数据统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    @GetMapping("/getBaseInfo")
    public AjaxResult getBaseInfo(String beginCreateTime,String endCreateTime){
        return AjaxResult.success(reportService.getBaseInfo(beginCreateTime,endCreateTime));
    }

    /*待办数据统计接口*/
    @GetMapping("/getTodoInfo")
    public AjaxResult getTodoInfo(String beginCreateTime,String endCreateTime){
        return AjaxResult.success(reportService.getTodoInfo(beginCreateTime,endCreateTime));
    }

    /**
     * 商机转化龙虎榜
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    @GetMapping("/businessChangeStatistics")
    public AjaxResult getBusinessChangeStatistics(String beginCreateTime,String endCreateTime){
        return AjaxResult.success(reportService.getBusinessChangeStatistics(beginCreateTime,endCreateTime));
    }

    /*线索转化龙虎榜*/
    @GetMapping("/salesStatistic")
    public AjaxResult getClueStatistic(String beginCreateTime,String endCreateTime){
        return AjaxResult.success(reportService.getClueStatistic(beginCreateTime,endCreateTime));
    }


}